#include<iostream>
using namespace std;
// 整数对分查找模板
int main()
{
    int n=100/*array size*/,target=0/*search target*/;
    int left=0,right=n-1,q[n];
    while(left<right)//模板1
    {
        int mid=(left+right+1)>>1;
        if(q[mid]<=target)/*边界为mid--right*/
        left=mid;
        else
            right=mid-1;
    }
    while (left<right) {
        int mid=(left+right)>>1;
        if(q[mid]<=target)left=mid;
        else
          right=mid-1;
    }
}